package com.allwees.core.common.exception;


/**
 * 异常基类
 *
 * @author yangylsky
 */
public class BaseException extends RuntimeException {

	private static final long serialVersionUID = -8045093092354848838L;

	protected int code;

	/**
	 * result code or actually message
	 */
	private String msg;

	/**
	 * args for i18n message source
	 */
	private Object[] args;

	public BaseException() {
		super();
	}

	public BaseException(int code) {
		super();
		this.code = code;
	}

	public BaseException(String msg) {
		super(msg);
		this.msg = msg;
	}

	public BaseException(Throwable cause) {
		super(cause);
	}

	public BaseException(int code, String message) {
		super(message);
		this.code = code;
		this.msg = message;
	}

	public BaseException(int code, Throwable cause) {
		super(cause);
		this.code = code;
	}

	public BaseException(String msg, Throwable cause) {
		super(cause);
		this.msg = msg;
	}

	public BaseException(int code, String message, Object[] args) {
		super(message);
		this.code = code;
		this.msg = message;
		this.args = args;
	}

	public int getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public Object[] getArgs() {
		return args;
	}
}
